package baobaotao.attr;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by Administrator on 2015/7/23.
 */
public class Test {

    public static void main(String[] args) {
        //父容器
        ClassPathXmlApplicationContext cpxac = new ClassPathXmlApplicationContext(new String[]{"baobaotao/attr/beans1.xml"});
        //指定cpxac为该容器的父容器
        ApplicationContext factory = new ClassPathXmlApplicationContext(new String[]{"baobaotao/attr/beans2.xml"}, cpxac);
        Boss boss = (Boss)factory.getBean("boss");
        System.out.println(boss.getCar().toString());

    }
}
